#!/bin/bash

rm -rf ./build.tar.gz
rm -rf ./build

echo "开始编译"
yarn build
if [ $? == 0 ]; then
    echo "开始打包"
    tar -czvf build.tar.gz build/* >/dev/null
    if [ $? == 0 ]; then
        scp build.tar.gz root@118.190.45.101:/tmp/
        if [ $? == 0 ]; then
            ssh root@118.190.45.101 "/bin/bash /shell/deploy/deploy_linux.sh" >/dev/null
        else
            echo "传输失败"
        fi
    else
        echo "打包失败"

    fi

else
    echo "编译失败"
fi
